package com.clstu.homeworks.homework04;

public class Employee {
    private String name;
    private double salary;
    private int workday;
    private double grade;

    public Employee(String name, double salary, int workday) {
        this.name = name;
        this.salary = salary;
        this.workday = workday;
        setGrade(1.0);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public int getWorkday() {
        return workday;
    }

    public void setWorkday(int workday) {
        this.workday = workday;
    }

    public double getGrade() {
        return grade;
    }

    public void setGrade(double grade) {
        this.grade = grade;
    }

    public double getmoney(){
        return grade*salary*workday;
    }

    public void say(){
        System.out.println("====================================");
        System.out.println("我是"+name+" ,工资："+getmoney());
    }
}

class Worker extends Employee{
    public Worker(String name, double salary, int workday) {
        super(name, salary, workday);
    }

    @Override
    public void say() {
        super.say();
        System.out.println("职位：普通工人");
    }
}

class Peasant extends Employee{
    public Peasant(String name, double salary, int workday) {
        super(name, salary, workday);
    }
    @Override
    public void say() {
        super.say();
        System.out.println("职位：农民工");
    }
}

class Waiter extends Employee{
    public Waiter(String name, double salary, int workday) {
        super(name, salary, workday);
    }
    @Override
    public void say() {
        super.say();
        System.out.println("职位：服务生");
    }
}

class Teacher extends Employee{
    private  double ke=1;
    public Teacher(String name, double salary, int workday) {
        super(name, salary, workday);
        setGrade(1.8);
    }
    @Override
    public void say() {
        super.say();
        System.out.println("职位：老师");
    }

    @Override
    public double getmoney() {
        return super.getmoney()+ke*getWorkday();
    }
}

class Scientist extends Employee{
    private double bonus=20000;
    public Scientist(String name, double salary, int workday) {
        super(name, salary, workday);
        setGrade(1.6);
    }
    @Override
    public void say() {
        super.say();
        System.out.println("职位：科学家");
    }

    @Override
    public double getmoney() {
        return super.getmoney()+bonus;
    }
}